package com.roden.study.java.jvm;

/**
 * @Author luodeng
 * @create 2021/9/15 14:06
 */
public class JmapTest {
    private JmapTest next;
    private Integer a;
    public JmapTest(int a) {
        this.a = a;
    }
    
    public static void main(String[] args) throws InterruptedException {
        JmapTest test = new JmapTest(300);
        fun(test);
        System.out.println(test.a);
    }
    
    public static void fun(JmapTest m) throws InterruptedException {
        System.out.println(m.a);
        m.next = new JmapTest(++m.a);
        //避免过早发送内存溢出
        Thread.sleep(5000);
        fun(m.next);
    }
}
